import * as React from 'react'
import {compose} from 'recompose'
import {curry} from 'ramda'

export default curry((functions: Array<Function>, ComposedComponent: React.Component) => {
    return class ComponentWillMount extends React.Component {

        componentWillMount() {
            let props = {};
            for (const func of functions || []) {
                func(this.props)
            }
        }

        render() {
            return (<ComposedComponent {...this.props}/>)
        }
    }
})